import url from './../../api/Constance'

<template>
    <div class="kanban">


        <el-table :data="items" style="width: 100%">
            <el-table-column label="地区" prop="province">
                <template slot-scope="scope">
                    <div class="template-name">
                        <b>{{scope.row.province}}</b>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="押金总额" prop="depositSum">
                <template slot-scope="scope">
                    <div class="template-name">
                        <b>{{scope.row.depositSum  | yuan}}</b>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="售价/租金总额" prop="priceSum">
                <template slot-scope="scope">
                    <div class="template-name">
                        <b>{{scope.row.priceSum  | yuan}}</b>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="平台抽成总额" prop="commissionSum">
                <template slot-scope="scope">
                    <div class="template-name">
                        <b>{{scope.row.commissionSum  | yuan}}</b>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="未返还总额" prop="totalSum">
                <template slot-scope="scope">
                    <div class="template-name">
                        <b>{{scope.row.totalSum  | yuan}}</b>
                    </div>
                </template>
            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination :page-size="form.size" :total="form.total" @current-change="summary"
                           layout="prev, pager, next"
                           width="1000">
            </el-pagination>
        </div>
    </div>
</template>


<script>
    export default {
        name: 'FinanceSummaryHistory',
        info: {},
        data() {
            return {
                form: {
                    page: 1,
                    size: 10,
                    total: 0,
                },
                items: [],
                detailDialogTitle: '',
                detailDialogShow: false,
                detailDialogItems: []
            }
        },
        methods: {
            summary(page) {
                if (page) {
                    this.form.page = page;
                }
                this.$fetch('/admin/financeSummaryHistory?page=' + this.form.page)
                    .then((response) => {
                        if (response.code === 0) {
                            this.items = response.data.records;
                            this.form.total = response.data.total
                        } else {
                            this.$message.error(response.errorMsg);
                        }
                    });
            },
        },
        mounted() {
            this.summary();
        }
    }
</script>

<style>
    .block {
        display: -webkit-flex;
        display: flex;
        justify-content: flex-end;
        padding: 15px 30px;
    }

    .kanban {
        padding: 25px 25px;
    }
</style>
